﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProjectRoughWork
{
    class ScreenChangeListener : EventListener
    {
        public ScreenChangeListener()
        {
        }

        public override void VHandleEvent(IEventData eventData)
        {
            //Cast Event to the appropriate event and retrieve the new screen

            EventChangeScreen tempEvt = (EventChangeScreen)eventData;
            IScreen newScreen = tempEvt.NewScreen;

            //Have the GameLogic change the screen

            ((ProjectGameLogic)ProjectGameLogic.GetInstance()).ChangeScreen(newScreen);

            base.VHandleEvent(eventData);
        }
    }
}
